Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update CI workflow for PHP versions #17

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Update CI workflow for PHP versions #17

wants to merge 5 commits into from

Conversation

koriym
Copy link
Member

@koriym koriym commented Nov 21, 2024

Add PHP 8.3 to old_stable and update current_stable to PHP 8.4. This ensures compatibility checks with the latest PHP versions.

Add PHP 8.3 to old_stable and update current_stable to PHP 8.4. This ensures compatibility checks with the latest PHP versions.
Copy link

coderabbitai bot commented Nov 21, 2024

📝 Walkthrough
📝 Walkthrough

Walkthrough

このプルリクエストでは、.github/workflows/continuous-integration.ymlファイルのciジョブに渡されるパラメータが変更されました。old_stableパラメータは、配列にバージョン「8.3」を追加することで、["8.1", "8.2"]から["8.1", "8.2", "8.3"]に更新されました。また、current_stableパラメータは、バージョン8.3から8.4に増加しました。これらの変更は、継続的インテグレーションワークフローのバージョニング戦略の更新を反映しています。さらに、src/Halo/TemplateLocator.phpファイルのTemplateLocatorクラスのコンストラクタにおける$twigPathsパラメータの属性アノテーションが変更され、src/Halo/HaloRenderer.phpファイルでは、addResourceMetaInfoメソッドの内部ロジックが更新され、エラーハンドリングが強化されました。

Changes

ファイル 変更概要
.github/workflows/continuous-integration.yml ciジョブのold_stableパラメータを["8.1", "8.2"]から["8.1", "8.2", "8.3"]に更新、current_stableパラメータを8.3から8.4に更新
src/Halo/TemplateLocator.php TemplateLocatorクラスのコンストラクタの$twigPathsパラメータの属性アノテーションを#[TwigPaths('twigPaths')]から#[TwigPaths]に変更
src/Halo/HaloRenderer.php addResourceMetaInfoメソッドの匿名関数のパラメータに型宣言を追加、リソースボディが見つからない場合にLogicExceptionをスローする処理を追加

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 2af3bf4 and bfdc630.

⛔ Files ignored due to path filters (2)
  • tests/Fake/app/composer.lock is excluded by !**/*.lock
  • vendor-bin/tools/composer.lock is excluded by !**/*.lock
📒 Files selected for processing (1)
  • src/Halo/HaloRenderer.php (2 hunks)
🧰 Additional context used
🪛 GitHub Check: codecov/patch
src/Halo/HaloRenderer.php

[warning] 146-146: src/Halo/HaloRenderer.php#L146
Added line #L146 was not covered by tests


[warning] 150-150: src/Halo/HaloRenderer.php#L150
Added line #L150 was not covered by tests

🔇 Additional comments (2)
src/Halo/HaloRenderer.php (2)

11-11: 新しい例外クラスのインポートが適切に追加されています

LogicExceptionのインポートは、リソースボディが見つからない場合の新しいエラーハンドリングをサポートするために必要な変更です。


142-150: ⚠️ Potential issue

コールバック関数の改善が必要です

以下の点について確認と改善が必要です:

  1. 型宣言の追加は良い改善ですが、より具体的な型(array{1: string})を使用することで、より安全な実装になります。
  2. 新しいエラーハンドリングは適切ですが、テストでカバーされていません。
  3. 空文字列を返す実装は、下流の処理に影響を与える可能性があります。

以下の変更を提案します:

-            /** @param array<int|string, string> $matches */
-            static function ($matches): string {
+            /** @param array{1: string} $matches */
+            static function (array $matches): string {
                 $uri = substr(explode(' ', $matches[1])[0], 1);
                 preg_match('/ <!-- resource_body_start -->(.*?)<!-- resource_body_end -->/s', $matches[1], $resourceBodyMatch);
 
                 if (! isset($resourceBodyMatch[1])) {
                     throw new LogicException('Resource body not found'); // @codeCoverageIgnore
                 }
 
-                return ''; // not used but needed for the callback signature
+                return $resourceBodyMatch[1];
             },

また、以下のテストケースの追加を推奨します:

public function testAddResourceMetaInfoWithMissingBody(): void
{
    $this->expectException(LogicException::class);
    $this->expectExceptionMessage('Resource body not found');
    
    // テストケースの実装をご希望の場合は、お申し付けください
}

実装の影響を確認するために、以下のスクリプトを実行してください:

🧰 Tools
🪛 GitHub Check: codecov/patch

[warning] 146-146: src/Halo/HaloRenderer.php#L146
Added line #L146 was not covered by tests


[warning] 150-150: src/Halo/HaloRenderer.php#L150
Added line #L150 was not covered by tests


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 407eb7a and e913258.

📒 Files selected for processing (1)
  • .github/workflows/continuous-integration.yml (1 hunks)

.github/workflows/continuous-integration.yml Show resolved Hide resolved
Copy link

codecov bot commented Nov 21, 2024

Codecov Report

Attention: Patch coverage is 33.33333% with 2 lines in your changes missing coverage. Please review.

Project coverage is 87.29%. Comparing base (8209086) to head (bfdc630).
Report is 51 commits behind head on master.

Files with missing lines Patch % Lines
src/Halo/HaloRenderer.php 33.33% 2 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff               @@
##              master      #17       +/-   ##
==============================================
- Coverage     100.00%   87.29%   -12.71%     
- Complexity        29       81       +52     
==============================================
  Files              5        8        +3     
  Lines            117      307      +190     
==============================================
+ Hits             117      268      +151     
- Misses             0       39       +39     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

Eliminated the 'twigPaths' parameter from the #[TwigPaths] attribute for cleaner code. This change simplifies the constructor definition and improves readability.
Bumped versions for several Composer dependencies including `composer/pcre`, `composer/semver`, and `symfony/config`. This update ensures compatibility with new features and fixes in these libraries, and adjusts `require-dev` settings and conflict resolutions accordingly.
This update introduces a LogicException to handle cases where the resource body is not found in the provided HTML snippet. This ensures the code fails gracefully with a clear error message if the expected resource body is missing, improving the robustness of the rendering functionality.
Updated the plugin-api-version in two composer.lock files from 2.2.0 to 2.6.0. This also included changes in 'platform' and 'platform-dev' fields from empty arrays to empty objects.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant